
import java.io.Serializable;
import java.rmi.RemoteException;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author ntthinh
 */
public class CategoryImpl implements Category, Serializable {
 private static final long serialVersionUID = 1L;
    CategoryType type;

    public void setCategory(CategoryType type) {
        this.type = type;
    }

    public CategoryType getCategory() throws RemoteException {
        return type;
    }

    public boolean isNoun() throws RemoteException {
        return CategoryType.NOM == type;
    }

    public boolean isVerb() throws RemoteException {
        return CategoryType.VERB == type;
    }

    public boolean isAdj() throws RemoteException {
        return CategoryType.ADJ == type;
    }

    public String printString() throws RemoteException {
        switch (type) {
            case NOM:
                return "NOM";
            case VERB:
                return "VBE";
            case ADJ:
                return "ADJ";
        }
        return null;
    }

    public String toFile() throws RemoteException {
        switch (type) {
            case NOM:
                return "NOM";
            case VERB:
                return "VBE";
            case ADJ:
                return "ADJ";
        }
        return null;
    }
}
